Skip to content

fix(id-store): recover poisoned admission locks instead of expect() (#13207) - #13252

Merged
dezren39 merged 1 commit into
mainfrom
xaltha/13207-admission-clippy
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
xaltha/13207-admission-clippy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

The clippy-native-shell gate (#5582) fails on main: pkgs/id/crates/id-store/src/admission.rs uses .expect() on Mutex::lock() at nine sites, and clippy::expect_used is denied workspace-wide. Each site now recovers the guard with .unwrap_or_else(|poisoned| poisoned.into_inner()) — the neighbouring modules' convention (id-core transport_advertisement.rs, id-sync protocol.rs, id-web lib.rs, id-store store_traits.rs).

Per-owner decision (the issue asked for one each):

  • FollowUpSink (request/drain): no error channel — PrepareHook::prepare returns a decision, so propagation would change the public hook API.
  • MemoryOperationLedger / MemoryOutboxJournal: public traits with non-Result signatures, and retry_outbox returns Vec, not Result; changing them is an API break for the follow-on Implement ordered lifecycle hooks and fixed acceptance gate #10192 wiring.
  • InFlightGuard::drop: Drop cannot return a Result at all.

Recovery preserves the pipeline's idempotent-binding and at-least-once semantics: std collections stay structurally valid after a panic. No API change, no new test file — the clippy gate itself is the failing-first oracle (it fails on main with the 9 errors, passes after).

Evidence

  • Before (issue reproduction, Lane QD, 2026-11-23): cargo clippy -p id-native-shell --all-targets → 9× error: used expect() on a Result value, could not compile id-store (lib) due to 9 previous errors.
  • After — remote dispatch, fleet-command run 45171765844, branch xaltha/13207-admission-clippy @ cbfe87ed6:
    • cargo clippy -p id-native-shell --all-targets — clean, finished dev profile in 3m 03s (only pre-existing pedantic/nursery warnings elsewhere, e.g. an unused Verifier import in id-core; no diagnostic touches admission.rs).
    • cargo test -p id-store — 383 passed, 0 failed across 16 suites (lib 271 + integration + doc-tests).
    • rustfmt --check clean on the touched file.
  • Dispatch notes: fleet queue dispatch itself is blocked by the TLS UnknownIssuer defect (fleet: repo-queue dispatch fails with TLS UnknownIssuer behind the egress proxy (Rust TLS ignores SSL_CERT_FILE) #13185), so this went through the fleet-command.yml workflow fallback. Two earlier runs failed on runner infra, not the code (nixbld group when run as root; root-owned CARGO_HOME git cache under the vscode user) — fixed with the runuser-vscode form + chown of $CARGO_HOME. That infra wart is worth a follow-up on the fleet workflow, not this PR.

Merge Danger

Low. One file, mechanical change, no API change. Behaviour change is strictly narrower: a poisoned lock now recovers the guard instead of panicking the pipeline run. If reviewers prefer a Poisoned variant on LifecycleRejection instead, that is a follow-up API change, not a blocker for this gate fix.

Closes #13207

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T12:31:11Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-13207",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-13207",
      "repo": "developing-today/code",
      "branch": "xaltha/13207-admission-clippy",
      "sha": "cbfe87ed643e72eee7b9badcd295f4a1e38fbe64"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…13207)

The clippy-native-shell gate (#5582) fails on main: admission.rs uses
.expect() on Mutex::lock() at nine sites, and clippy::expect_used is
denied workspace-wide. Each site now recovers the guard with
unwrap_or_else(|poisoned| poisoned.into_inner()), the neighbouring
modules' convention (id-core transport_advertisement.rs, id-sync
protocol.rs, id-web lib.rs, id-store store_traits.rs).

Per-owner decision (issue asked for one each):
- FollowUpSink (request/drain): no error channel — PrepareHook::prepare
  returns a decision, so propagation would change the public hook API.
- MemoryOperationLedger / MemoryOutboxJournal: public traits with
  non-Result signatures, and retry_outbox returns Vec, not Result;
  changing them is an API break for the follow-on #10192 wiring.
- InFlightGuard::drop: Drop cannot return a Result at all.
Recovery preserves the pipeline's idempotent-binding and at-least-once
semantics: std collections stay structurally valid after a panic.

Closes #13207
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4980191b-e0a3-47f1-9603-3ac487582e74
Commits

Reviewing files that changed from the base of the PR and between 4cfceaa and cbfe87e.

Files selected for processing: 1

  • pkgs/id/crates/id-store/src/admission.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T12:33:00.986714Z cbfe87e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 4473da0 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the xaltha/13207-admission-clippy branch November 23, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id-store: admission.rs expect() on Mutex locks breaks the clippy gates on main (PR #13156)

1 participant